<html>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<head>
<title>Section 21.2.&nbsp; The Internet Printing Protocol</title>
<link rel="STYLESHEET" type="text/css" href="images/style.css">
<link rel="STYLESHEET" type="text/css" href="images/docsafari.css">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;"><a href="toc.html"><img src="images/team.gif" width="60" height="17" border="0" align="absmiddle"  alt="Team BBL"></a></div></td>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=ch21lev1sec1.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<a href=ch21lev1sec3.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
<br><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top"><a name="ch21lev1sec2"></a>
<h3 class="docSection1Title">21.2. The Internet Printing Protocol</h3>
<p class="docText">IPP specifies the communication rules for building network-based printing systems. By embedding an IPP server inside a printer with an Ethernet card, the printer can service requests from many computer systems. These computer systems need not be located on the same physical network, however. IPP is built on top of standard Internet protocols, so any computer that can create a TCP/IP connection to the printer can submit a print job.</P>
<p class="docText">Specifically, IPP is built on top of HTTP, the Hypertext Transfer Protocol (<a class="docLink" href="ch21lev1sec3.html#ch21lev1sec3">Section 21.3</a>). HTTP, in turn, is built on top of TCP/IP. The structure of an IPP message is shown in <a class="docLink" href="#ch21fig01">Figure 21.1</a>.</P>
<a name="ch21fig01"></a><p><center>
<H5 class="docFigureTitle">Figure 21.1. Structure of an IPP message</H5>
<p class="docText"><div class="v1"><a target="_self" href="images/0201433079/graphics/21fig01_alt.gif;423615">[View full size image]</a></div><img border="0" alt="" width="500" height="59" SRC="images/0201433079/graphics/21fig01.gif;423615"></P>
</center></p><BR>
<p class="docText">IPP is a requestresponse protocol. A client sends a request message to a server, and the server answers with a response message. The IPP header contains a field that indicates the requested operation. Operations are defined to submit print jobs, cancel print jobs, get job attributes, get printer attributes, pause and restart the printer, place a job on hold, and release a held job.</P>
<p class="docText"><a class="docLink" href="#ch21fig02">Figure 21.2</a> shows the structure of an IPP message header. The first 2 bytes are the IPP version number. For protocol version 1.1, each byte has a value of 1. For a protocol request, the next 2 bytes contain a value identifying the requested operation. For a protocol response, these 2 bytes contain a status code instead.</P>
<a name="ch21fig02"></a><p><center>
<H5 class="docFigureTitle">Figure 21.2. Structure of an IPP header</h5>

<p class="docText">
<img border="0" alt="" width="385" height="242" SRC="images/0201433079/graphics/21fig02.gif;423615"></P>

</center></P><BR>
<p class="docText">The next 4 bytes contain an integer identifying the request. Optional attributes follow this, terminated by an end-of-attributes tag. Any data that might be associated with the request follows immediately after the end-of-attributes tag.</p>
<p class="docText">In the header, integers are stored as signed, two's-complement, binary values in big-endian byte order (i.e., network byte order). Attributes are stored in groups. Each group starts with a single byte identifying the group. Within each group, an attribute is generally represented as a 1-byte tag, followed by a 2-byte name length, followed by the name of the attribute, followed by a 2-byte value length, and finally the value itself. The value can be encoded as a string, a binary integer, or a more complex structure, such as a date/timestamp.</P>
<p class="docText"><a class="docLink" href="#ch21fig03">Figure 21.3</a> shows how the <tt>attributes-charset</tt> attribute would be encoded with a value of <tt>utf-8</tt>.</P>
<a name="ch21fig03"></a><p><center>
<H5 class="docFigureTitle">Figure 21.3. Sample IPP attribute encoding</H5>

<p class="docText">
<img border="0" alt="" width="380" height="242" SRC="images/0201433079/graphics/21fig03.gif;423615"></p>

</center></p><br>
<p class="docText">Depending on the operation requested, some attributes are required to be provided in the request message, whereas others are optional. For example, <a class="docLink" href="#ch21fig04">Figure 21.4</a> shows the attributes defined for a print-job request.</p>
<a name="ch21fig04"></a><P><table cellspacing="0" class="allBorders" border="1" RULES="groups" cellpadding="5"><caption><h5 class="docTableTitle">Figure 21.4. Attributes of print-job request</H5></caption><colgroup><col width="175"><col width="50"><col width="275"></colgroup><thead><tr><th class="rightBorder bottomBorder thead" scope="col" align="center" valign="top"><p class="docText"><span class="docEmphRoman">Attribute</span></P></th><th class="rightBorder bottomBorder thead" scope="col" align="left" valign="top"><p class="docText"><span class="docEmphRoman">Status</span></p></th><th class="bottomBorder thead" scope="col" align="center" valign="top"><p class="docText"><span class="docEmphRoman">Description</span></p></th></tr></thead><tr><td class="rightBorder" align="left" valign="top"><p class="docText"><tt>attributes-charset</tt></p></td><td class="rightBorder" align="left" valign="top"><p class="docText">required</p></td><td class="docTableCell" align="left" valign="top"><p class="docText">The character set used by attributes of type <tt>text</tt> or <tt>name</tt>
</p></td></tr><tr><td class="rightBorder" align="left" valign="top"><p class="docText"><tt>attributes-natural-language</tt></p></TD><TD class="rightBorder" align="left" valign="top"><p class="docText">required</p></TD><TD class="docTableCell" align="left" valign="top"><p class="docText">The natural language used by attributes of type <tt>text</tt> or <tt>name</tt>
</P></td></TR><TR><TD class="rightBorder" align="left" valign="top"><p class="docText"><tt>printer-uri</tt></p></TD><td class="rightBorder" align="left" valign="top"><p class="docText">required</P></TD><TD class="docTableCell" align="left" valign="top"><p class="docText">The printer's Universal Resource Identifier</p></TD></TR><tr><TD class="rightBorder" align="left" valign="top"><p class="docText"><tt>requesting-user-name</tt></P></td><td class="rightBorder" align="left" valign="top"><p class="docText">optional</p></td><TD class="docTableCell" align="left" valign="top"><p class="docText">Name of user submitting job (used for authentication, if enabled)</p></TD></tr><TR><td class="rightBorder" align="left" valign="top"><p class="docText"><tt>job-name</tt></p></td><td class="rightBorder" align="left" valign="top"><p class="docText">optional</p></td><td class="docTableCell" align="left" valign="top"><p class="docText">Name of job used to distinguish between multiple jobs</p></td></tr><tr><td class="rightBorder" align="left" valign="top"><p class="docText"><tt>ipp-attribute-fidelity</tt></p></td><td class="rightBorder" align="left" valign="top"><p class="docText">optional</p></td><TD class="docTableCell" align="left" valign="top"><p class="docText">If true, tells printer to reject job if all attributes can't be met; otherwise, printer does its best to print the job</P></td></TR><TR><TD class="rightBorder" align="left" valign="top"><p class="docText"><tt>document-name</tt></p></TD><TD class="rightBorder" align="left" valign="top"><p class="docText">optional</P></td><TD class="docTableCell" align="left" valign="top"><p class="docText">The name of the document (suitable for printing in a banner, for example)</p></TD></TR><TR><td class="rightBorder" align="left" valign="top"><p class="docText"><tt>document-format</tt></P></TD><td class="rightBorder" align="left" valign="top"><p class="docText">optional</P></TD><td class="docTableCell" align="left" valign="top"><p class="docText">The format of the document (plaintext, PostScript, etc.)</p></td></tr><TR><td class="rightBorder" align="left" valign="top"><p class="docText"><tt>document-natural-language</tt></P></td><TD class="rightBorder" align="left" valign="top"><p class="docText">optional</p></td><td class="docTableCell" align="left" valign="top"><p class="docText">The natural language of the document</p></td></tr><tr><td class="rightBorder" align="left" valign="top"><p class="docText"><tt>compression</tt></p></td><td class="rightBorder" align="left" valign="top"><p class="docText">optional</p></td><td class="docTableCell" align="left" valign="top"><p class="docText">The algorithm used to compress the document data</p></td></tr><TR><TD class="rightBorder" align="left" valign="top"><p class="docText"><tt>job-k-octets</tt></p></TD><TD class="rightBorder" align="left" valign="top"><p class="docText">optional</P></td><TD class="docTableCell" align="left" valign="top"><p class="docText">Size of the document in 1,024-octet units</P></TD></tr><TR><td class="rightBorder" align="left" valign="top"><p class="docText"><tt>job-impressions</tt></P></TD><TD class="rightBorder" align="left" valign="top"><p class="docText">optional</p></TD><TD class="docTableCell" align="left" valign="top"><p class="docText">Number of impressions (images imposed on a page) submitted in this job</p></TD></TR><tr><td class="rightBorder" align="left" valign="top"><p class="docText"><tt>job-media-sheets</tt></p></td><TD class="rightBorder" align="left" valign="top"><p class="docText">optional</p></TD><td class="docTableCell" align="left" valign="top"><p class="docText">Number of sheets printed by this job</P></td></tr></table></p><br>
<p class="docText">The IPP header contains a mixture of text and binary data. Attribute names are stored as text, but sizes are stored as binary integers. This complicates the process of building and parsing the header, since we need to worry about such things as network byte order and whether our host processor can address an integer on an arbitrary byte boundary. A better alternative would have been to design the header to contain text only. This simplifies processing at the cost of slightly larger protocol messages.</p>
<p class="docText"><a name="idd1e154657"></a><a name="idd1e154660"></a>IPP is specified in a series of documents (Requests For Comments, or RFCs) available at <a class="docLink" target="_blank" href="http://www.pwg.org/ipp"><tt>http://www.pwg.org/ipp</tt></a>. The main documents are listed in <a class="docLink" href="#ch21fig05">Figure 21.5</a>, although many other documents are available to further specify administrative procedures, job attributes, and the like.</p>
<a name="ch21fig05"></a><p><table cellspacing="0" class="allBorders" border="1" RULES="groups" cellpadding="5"><caption><h5 class="docTableTitle">Figure 21.5. Primary IPP RFCs</h5></caption><colgroup><col width="40"><col width="460"></colgroup><thead><tr><th class="rightBorder bottomBorder thead" scope="col" align="left" valign="top"><p class="docText"><span class="docEmphRoman">RFC</span></p></th><th class="rightBorder bottomBorder thead" scope="col" align="center" valign="top"><p class="docText"><span class="docEmphRoman">Title</span></p></th></tr></thead><tr><td class="rightBorder" align="left" valign="top"><p class="docText">2567</p></td><TD class="docTableCell" align="left" valign="top"><p class="docText">Design Goals for an Internet Printing Protocol</P></td></TR><TR><TD class="rightBorder" align="left" valign="top"><p class="docText">2568</p></TD><TD class="docTableCell" align="left" valign="top"><p class="docText">Rationale for the Structure of the Model and Protocol for the Internet Printing Protocol</P></td></TR><tr><TD class="rightBorder" align="left" valign="top"><p class="docText">2911</P></TD><td class="docTableCell" align="left" valign="top"><p class="docText">Internet Printing Protocol/1.1: Model and Semantics</P></TD></tr><TR><TD class="rightBorder" align="left" valign="top"><p class="docText">2910</p></td><td class="docTableCell" align="left" valign="top"><p class="docText">Internet Printing Protocol/1.1: Encoding and Transport</p></TD></tr><TR><td class="rightBorder" align="left" valign="top"><p class="docText">3196</P></td><td class="docTableCell" align="left" valign="top"><p class="docText">Internet Printing Protocol/1.1: Implementor's Guide</p></td></tr></table></p><br>

<a href="17021535.html"><img src="images/pixel.gif" alt="" width="1" height="1" border="0"></a><ul></ul></td></tr></table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;"><a href="toc.html"><img src="images/team.gif" width="60" height="17" border="0" align="absmiddle"  alt="Team BBL"></a></div></td>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=ch21lev1sec1.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<a href=ch21lev1sec3.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
</body></html><br>
<table width="100%" cellspacing="0" cellpadding="0"
style="margin-top: 0pt; border-collapse: collapse;"> 
<tr> <td align="right" style="background-color=white; border-top: 1px solid gray;"> 
<a href="http://www.zipghost.com/" target="_blank" style="font-family: Tahoma, Verdana;
 font-size: 11px; text-decoration: none;">The CHM file was converted to HTM by Trial version of <b>ChmD<!--251-->ecompiler</b>.</a>
</TD>
</TR><tr>
<td align="right" style="background-color=white; "> 
<a href="http://www.etextwizard.com/download/cd/cdsetup.exe" target="_blank" style="font-family: Tahoma, Verdana;
 font-size: 11px; text-decoration: none;">Download <b>ChmDec<!--251-->ompiler</b> at: http://www.zipghost.com</a>
</TD></tr></table>
